package com.hyh.blog.service.impl;

import com.hyh.blog.dao.UserRepository;
import com.hyh.blog.po.User;
import com.hyh.blog.service.UserService;
import com.hyh.blog.util.MD5Utils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author Summerday
 */

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserRepository userRepository;


    @Override
    public User loadUser(String username, String password) {
        return userRepository.findByUsernameAndPassword(username, MD5Utils.code(password));
    }
}
